#ifndef HELPERS_H
#define HELPERS_H

#include "database.h"

namespace acidone
{

class CategoryManager
{
public:

	enum EmbeddedCategory
	{
		In = 0,
		Day = 1,
		Later = 2,
		Control = 3,
		Maybe = 4,
		Done = 5,
		LastCategory = Done,
		EmbeddedCategoryCount = LastCategory + 1,
	};

public:
	explicit CategoryManager(const Database* database);

	void setEmbeddedCategory(EmbeddedCategory type, Category* category);
	Category* embeddedCategory(EmbeddedCategory type) const;

	bool isEmbeddedCategory(Category* category) const;
	EmbeddedCategory embeddedCategoryType(Category* category) const;

	Database::Categories embeddedCategories() const;
	Database::Categories optionalCategories() const;

	Category* getTaskEmbeddedCategory(const Task* task) const;
	Database::Categories getTaskOptionalCategories(const Task* task) const;

private:
	const Database* m_database;
	Database::Categories m_embeddedCategories;
};

}

#endif // HELPERS_H
